package de.mrclrchtr.education.account.dto

import de.mrclrchtr.education.account.jooq.tables.pojos.Role
import de.mrclrchtr.education.account.jooq.tables.pojos.User
import java.io.Serializable

data class UserDto(
    var id: Int? = null,
    var name: String? = null,
    var age: Int? = null,
    var roleList: List<Role>? = null
) : Serializable {
    companion object {
        // 将 jOOQ 生成的 Role 对象转换为 RoleDto 对象
        @JvmStatic
        fun convertToCustomRole(user: User, roleList: List<Role>): UserDto {
            return UserDto(user.id, user.name, user.age, roleList)
        }
    }
}



